package com.wtzz.police.base.entity;

import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;
import java.io.Serializable;

@ApiModel("部门")
@Data
@EqualsAndHashCode(callSuper = true)
@Entity
@Table(name = "department",
       indexes = {@Index(columnList = "name", name = "index_name")},
       uniqueConstraints = {@UniqueConstraint(name = "unique_department_name", columnNames = "name"),
                            @UniqueConstraint(name = "unique_department_code", columnNames = "code")})
public class Department extends AbstractTimeEntity implements Serializable {

    private static final long serialVersionUID = -203698894499843912L;
    /**
     * 部门编码
     */
    @Column(length = 50, nullable = false)
    private String code;
    /**
     * 部门简称
     */
    @Column(nullable = false)
    private String name;
    /**
     * 部门全称
     */
    private String fullname;
    /**
     * 是否正常使用
     */
    private Boolean enable = true;
}
